<include file="Public/min-header"/>


<script type="text/javascript" charset="utf-8" src="__ROOT__/Public/plugins/Ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__ROOT__/Public/plugins/Ueditor/ueditor.all.js"> </script>
 <script type="text/javascript" charset="utf-8" src="__ROOT__/Public/plugins/Ueditor/lang/zh-cn/zh-cn.js"></script>
 <link href="__PUBLIC__/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
 <script src="__PUBLIC__/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
 <script src="__PUBLIC__/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<script type="text/javascript">  

//     var ue = UE.getEditor('xuzhi', {
//         // ... 更多配置
//         serverUrl:URL_Config,
// 		allowDivTransToP:false,
// 		initialFrameHeight:200
// //     });
//         var ue2 = UE.getEditor('lipin', {
//         // ... 更多配置
//         serverUrl:URL_Config,
// 		allowDivTransToP:false,
// 		initialFrameHeight:200
//     });
</script>
<div class="wrapper">
    <include file="Public/breadcrumb"/>
    <section class="content" style="padding:0px 15px;">
        <!-- Main content -->
        <div class="container-fluid">
            <div class="pull-right">
                <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="返回"><i class="fa fa-reply"></i></a>
            </div>
            <div class="panel panel-default">
                <div class="panel-body ">   
                   	<ul class="nav nav-tabs">
                        <foreach name="group_list" item="vo" key="k">
                     		<li <if condition="$k eq 'full_reduction'">class="active"</if>><a href="javascript:void(0)" data-url="{:U('System/index',array('inc_type'=>$k))}" data-toggle="tab" onclick="goset(this)">{$vo}</a></li>
                     	</foreach>
                    </ul>
                    <!--表单数据-->
                   
                     <form method="post" id="handlepost" action="{:U('Promotion/fullSave')}">
                        <!--通用信息-->
                    <div class="tab-content" style="padding:20px 0px;">
                        <a  class="btn btn-primary" onclick="addTr()">增加</a>
                        
                        <div class="tab-pane active" id="tab_tongyong">
                            <table class="table table-bordered">
                                <tbody class="a">
								<tr>
								    <td>区间时间数据：</td>
								    <td>
								        <input type="text" class="input-sm" name="full_shijian1" id="full_shijian1" value="{$info.full_shijian1}"/>->
								        <input type="text" class="input-sm" name="full_shijian2" id="full_shijian2" value="{$info.full_shijian2}" ></td>
									<td>
									</td>
								</tr>
								
							    <volist name='info.full' id="vo">
                                <tr>
                                    <td>礼物：</td>
                                    <td>
                                        价钱：<input type="text"  class="input-sm"   title="价钱"   name="full_price[]" value="{$vo.price}" >
                                        礼品：<input type="text"  class="input-sm" title="礼品名称"  name="full_gift[]" value="{$vo.gift}" >
                                    </td>
                                	<td><a  class="btn btn-primary" onclick="del(this)">删除</a></td>
                                </tr>
                                </volist>
                                </tbody> 
                                <tfoot>
                                	<tr>
                                	<td><input type="hidden" name="inc_type" value="{$inc_type}"></td>
                                	<td class="text-right"><input class="btn btn-primary" type="button" onclick="adsubmit()" value="保存"></td>
                                	<td></td>
                                	</tr>
                                </tfoot>
                                </table>
                        </div>
                    </div>
			    	</form><!--表单数据-->
                </div>
            </div>
        </div>
    </section>
</div>

<script>
function adsubmit(){
	$('#handlepost').submit();
}

$(document).ready(function(){
	get_province();
});

function goset(obj){
	window.location.href = $(obj).attr('data-url');
}

$(document).ready(function() {
	$('#full_shijian1,#full_shijian2').daterangepicker({
		format:"YYYY-MM-DD HH:mm",
		singleDatePicker: true,
		showDropdowns: true,
		minDate:'{$time}',
		maxDate:'2030-01-01 00:00',
		startDate:'{$time}',
		showWeekNumbers: true,
		timePicker: true,
		timePickerIncrement: 1,
		timePicker12Hour: false,
	    locale : {
            applyLabel : '确定',
            cancelLabel : '取消',
            fromLabel : '起始时间', 
            toLabel : '结束时间',
            customRangeLabel : '自定义',
            daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
            monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月','七月', '八月', '九月', '十月', '十一月', '十二月' ],
            firstDay : 1
        }
	});
});

    function addTr(){
        var html = "<tr>\n" +
"                                    <td>礼物：</td>\n" +
"                                    <td>\n" +
"                                        价钱：<input type=\"text\"   title=\"价钱\"  class=\"input-sm\" name=\"full_price[]\" value=\"{$config.full_price}\" >\n" +
"                                        礼品：<input type=\"text\"   title=\"礼品名称\"  class=\"input-sm\" name=\"full_gift[]\" value=\"{$config.full_gift}\" >\n" +
"                                    </td>\n" +
"                                \t<td><a  class=\"btn btn-primary\" onclick=\"del(this)\">删除</a></td>\n" +
"                                </tr>"
        $('.a').append(html)
    }
    
    function del(obj){
        $(obj).parent().parent().remove()
    }
    


</script>
</body>
</html>